package com.stand.hardcode.controller;

import java.io.IOException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.stand.hardcode.entity.StandUser;
import com.stand.hardcode.exception.UsernameTakenException;
import com.stand.hardcode.manager.UserManager;

public class GenerateDataServlet extends HttpServlet{
	public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
		//make 2 administrator accounts
		

		StandUser u1= new StandUser("HardcodeTest1", "hardcodetest1@gmail.com");
		u1.setAdmin(true);
		
		StandUser u2= new StandUser("HardcodeTest2", "hardcodetest2@gmail.com");
		u2.setAdmin(true);
		
		try {
			UserManager.StoreUser(u1);
		} catch (UsernameTakenException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		try {
			UserManager.StoreUser(u2);
		} catch (UsernameTakenException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		resp.getWriter().println("admin accounts created");
		
		
		
		
	}
	
	
	
	

}
